package com.chaosj.skill.prometheus

import io.micrometer.core.instrument.DistributionSummary
import io.micrometer.core.instrument.simple.SimpleMeterRegistry

/**
 * @Description:
 * @author caoyangjie
 * @date 2020年01月2020/1/14日 14:14
 * @Copyright: © 赢时胜
 */
class SummarySample {
    static void main(args){
        DistributionSummary summary = DistributionSummary.builder("summary")
                .tag("summary", "summary")
                .description("summary")
                .register(new SimpleMeterRegistry())
        summary.record(2D)
        summary.record(3D)
        summary.record(4D)
        System.out.println(summary.measure())
        System.out.println(summary.count())
        System.out.println(summary.max())
        System.out.println(summary.mean())
        System.out.println(summary.totalAmount())
    }
}
